<template>
  <div>
    <a-row style="margin-top: 20px">
      <a-col
        :span="24"
        style="padding-right: 10px"
      >
        <a-row style="margin-bottom: 40px;">
          <a-col
            class="it-col-wrapper"
            :span="11"
          >
            <div class="col-title">
              虚拟机概览
            </div>

            <div class="content-wrapper">
              <a-icon
                type="cloud-upload"
                class="col-logo"
              />
              <div class="col-content">
                <span>虚拟机</span>
                <span>{{platformData.vmNum || 0}}台</span>
              </div>
            </div>
          </a-col>

          <a-col :span="1" />

          <a-col
            class="it-col-wrapper"
            :span="11"
          >
            <div class="col-title">
              容器概览
            </div>

            <div class="content-wrapper">
              <a-icon
                type="code-sandbox"
                class="col-logo"
              />
              <div class="col-content">
                <span>容器集群</span>
                <span>{{platformData.dockerNum || 0}}个</span>
              </div>
            </div>
          </a-col>
        </a-row>
      </a-col>
    </a-row>
  </div>
</template>

<script>
  export default {
    name: 'PlatformResource',
    props: {
      platformData: {
        type: Object,
        default: () => ({})
      },
    },
  }
</script>

<style
  lang="less"
  scoped
>
  .it-col-wrapper {
    padding: 30px 35px;
    border: 1px solid #ddd;
    border-radius: 4px;

    .col-title {
      display: flex;
      align-items: center;
      font-size: 18px;
      color: #017972;
      padding-left: 10px;
      margin-bottom: 20px;

      &::before {
        content: '';
        height: 16px;
        display: inline-block;
        border-left: 2px solid #017972;
        padding-right: 10px;
      }
    }

    .col-icon {
      margin: 0 8% 0 16%;
      color: #009688;
      font-size: 62px;
    }

    .content-wrapper {
      display: flex;
      align-items: center;

      img {
        margin: 0 8% 0 16%;
      }

      .col-logo {
        margin: 0 8% 0 16%;
        color: #009688;
        font-size: 64px;
      }

      .col-content {
        display: inline-block;

        & span {
          display: block;

          &:first-child {
            font-size: 16px;
          }

          &:last-child {
            font-size: 24px;
            font-weight: bolder;
          }
        }
      }
    }
  }
</style>